<?php

class RequestContext {

    private $current_action;
    private $forward_action;
    private $current_controller;
    private $error_action;
    
    public function __construct() {
        $this->error_action = new Action('error::show');
    }
    
    public function setStatus($status) {
        $this->current_controller->setStatus($status);
    }
    public function setErrorAction($action) {
        $this->error_action = $action;
    }
    public function getErrorAction() {
        return $this->error_action;
    }
    public function getCurrentAction() {
        return $this->current_action;
    }

    public function getForwardAction() {
        return $this->forward_action;
    }

    public function getCurrentController() {
        return $this->current_controller;
    }

    public function getArgs() {
        return $this->current_action->getArgs();
    }

    public function setCurrentAction(Action $action) {
        $this->current_action = $action;
    }

    public function setForwardAction(Action $action) {
        $this->forward_action = $action;
    }

    public function unsetForwardAction() {
        $this->forward_action = null;
    }
    
    public function setCurrentController(Controller $controller) {
        $this->current_controller = $controller;
    }

}
?>
